import { defineStore } from "pinia";
import { requestDataApi } from "@/api/data"
import type { ReportDataModel } from "@/api/data/model"

interface DataStoreType {
  reportData: ReportDataModel
}

const useDataStore = defineStore('data', {
  state: (): DataStoreType => {
    return {
      reportData: {},
    }
  },
  actions: {
    async getData() {
      const result = await requestDataApi()
      this.reportData = result
    }
  },
  getters: {}
})

export default useDataStore